<template>
  <view>
    <van-tabs :active="active">
      <van-tab :title="item.name" v-for="item in tabs.navData" :key="item.id">
        <ul>
          <li v-for="item in list" :key="item.id">
            <image :src="item.list_pic_url" mode=""></image>
            <p></p>
            <p></p>
          </li>
        </ul>
      </van-tab>
    </van-tabs>
  </view>
</template>

<script>
  import http from "../../http/http.js"
  export default {
    data() {
      return {
        active: 0,
        tabs: [],
        list:[]
      };
    },
    methods: {
      async num(id) {
        let res = await http.get('http://shop.bufantec.com/bufan/category/categoryNav?id=1005000')
        console.log(res)
        this.tabs = res.data
      },
      async sum(id){
        let res=await http.get('http://shop.bufantec.com/bufan/goods/goodsList?categoryId='+ id)
        console.log(res)
        this.list=res.data
      }
    },
    mounted() {
      this.num()
      this.sum()
    }
  }
</script>

<style lang="scss">

</style>
